﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace NetPE.Dialogs
{
    public partial class GotoDialog : Form
    {
        public GotoDialog()
        {
            InitializeComponent();
        }

        public event EventHandler<GotoEventArgs> Goto;
        

        private void button1_Click(object sender, EventArgs e)
        {
            int pos;
            if (!int.TryParse(textBox1.Text, NumberStyles.HexNumber, null, out pos))
            {
                MessageBox.Show("Invaild Hex Number!");
                return;
            }
            if (Goto != null)
                Goto(this, new GotoEventArgs(pos));
        }
    }
    public class GotoEventArgs : EventArgs
    {
        public GotoEventArgs(int pos) { this.pos = pos; }
        int pos;
        public int Position { get { return pos; } }
    }
}
